app.controller('pieController', function ($scope) {

    $scope.pie = {
        title: {
            position: "bottom",
            text: "List Of Customer Countries name last 6 months"
        },
        legend: {
            position : 'left'
        },
        chartArea: {
            background: ""
        },
        seriesDefaults: {
            labels: {
                visible: true,
                background: "transparent",
                template: "#= category #: #= value#%"
            }
        },
        series: [{
            type: "pie",
            name : "category",
            field: "value",
            categoryField: "category"
        }],
        tooltip: {
            visible: true,
            format: "{0}%"
        }
    };

    $scope.countries = new kendo.data.DataSource({
        transport: {
            read: {
                url: "/pieChartRecords",
                dataType: "json"
            }
        }

    });

})


app.controller('barController', function ($scope) {


    $scope.source = new kendo.data.DataSource({
        transport: {
            read: {
                url: "/barChartRecords",
                dataType: "json"
            }
        }
    });
})

